package com.kara.woodAgent.agent.graph;

import com.kara.woodAgent.agent.graph.impl.ModelCheckpointNode;
import com.kara.woodAgent.agent.graph.impl.ModelNode;
import com.kara.woodAgent.agent.graph.impl.ReactGraphContext;
import com.kara.woodAgent.agent.graph.impl.ToolNode;
import com.kara.woodAgent.agent.model.ModelProvider;
import com.kara.woodAgent.agent.tool.provider.ToolProvider;

/**
 * @author tzy
 * @version 1.0
 * @project wood_agent
 * @description
 * @date 2025/6/4 12:52:17
 */
public class Graphs {


	/*
	*  构建reactGraph
	*             end
	*              |
	*  start  ->  model ----------->tool
	*              |                  |
	*              --<---<-----<--<-- |
	*
	* */
	public static BaseGraph<ReactGraphContext> createReactGraph(ModelProvider modelProvider, ToolProvider.ToolServiceHolder toolProviderHolder) {
		return new BaseGraph<ReactGraphContext>()
				.addStartNode("model", new ModelNode(modelProvider, toolProviderHolder))
				.addNode("tool", new ToolNode(toolProviderHolder));
	}


	public static BaseGraph<ReactGraphContext> createReactGraphWithCheckpoint(ModelProvider modelProvider, ToolProvider.ToolServiceHolder toolProviderHolder) {
		return new BaseGraph<ReactGraphContext>()
				.addStartNode("model", new ModelCheckpointNode(modelProvider, toolProviderHolder))
				.addNode("tool", new ToolNode(toolProviderHolder));
	}
}
